package cn.csc.module.pay.dal.mysql.jzbordererrlog;

import cn.csc.framework.common.pojo.PageResult;
import cn.csc.framework.mybatis.core.mapper.BaseMapperX;
import cn.csc.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.csc.module.pay.controller.admin.jzborder.vo.JzbOrderErrlogExportReqVO;
import cn.csc.module.pay.controller.admin.jzborder.vo.JzbOrderErrlogPageReqVO;
import cn.csc.module.pay.dal.dataobject.jzborder.JzbOrderErrlogDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;


/**
 * 见证宝订单表错误日志 Mapper
 *
 * @author 曾铁树
 */
@Mapper
public interface JzbOrderErrlogMapper extends BaseMapperX<JzbOrderErrlogDO> {

    default PageResult<JzbOrderErrlogDO> selectPage(JzbOrderErrlogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<JzbOrderErrlogDO>()
                .eqIfPresent(JzbOrderErrlogDO::getJzbOrderId, reqVO.getJzbOrderId())
                .eqIfPresent(JzbOrderErrlogDO::getTypeId, reqVO.getTypeId())
                .eqIfPresent(JzbOrderErrlogDO::getMessage, reqVO.getMessage())
                .orderByDesc(JzbOrderErrlogDO::getId));
    }

    default List<JzbOrderErrlogDO> selectList(JzbOrderErrlogExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<JzbOrderErrlogDO>()
                .eqIfPresent(JzbOrderErrlogDO::getJzbOrderId, reqVO.getJzbOrderId())
                .eqIfPresent(JzbOrderErrlogDO::getTypeId, reqVO.getTypeId())
                .eqIfPresent(JzbOrderErrlogDO::getMessage, reqVO.getMessage())
                .orderByDesc(JzbOrderErrlogDO::getId));
    }

}
